<!DOCTYPE html>
<html>
<head>
    <title class="title"></title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap/js/bootstrap.min.js"></script>
    <script src="/js/plugins/jrender/jrender.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/userTravels.css"/>
    <link rel="stylesheet" href="/js/plugins/dialog/dialog.css"/>
    <script src="/js/plugins/dialog/dialog.min.js"></script>
    <script src="/js/common.js"></script>
</head>

<body>
<div class="search-head">
    <div class="row nav-search">
        <div class="col">
            <a href="javascript:window.history.go(-1)" >
                <span><i class="fa fa-chevron-left"></i></span>
            </a>
        </div>
        <div class="col">
            <span class="title"></span>
        </div>
        <div class="col"></div>
    </div>
</div>

<div class="container fansOrWatchs">
    <dl class="list" render-loop="list">

        <dd>
            <a render-key="list.id" render-fun="handler">
               <!-- render-key="list.id" render-fun="handler"-->
                <img class=" dynamic-head" render-src="list.headImgUrl" style="width: 50px">
            </a>
            <a  class="dynamic-detail" render-key="list.id" render-fun="handler">
                <span render-html="list.nickName"></span>
            </a>
        </dd>
    </dl>
</div>
<script>
    $(function () {
        var id = getParams().id;
        var type = getParams().type;
        //回显出标题
        if(type=='fans'){
            $(".title").html("他的粉丝");
        }else if(type=="watch"){
            $(".title").html("他的关注");
        }
        //回显出粉丝或关注的人
         $.get("/users/"+id+"/fansOrWatchs",{type:type},function (data) {
             console.log({list:data});
             $(".fansOrWatchs").renderValues({list:data},{
                 handler:function (ele,value) {
                     ele.href="/userProfiles.html?id="+value;
                 }
             });
         })
    })
</script>
</body>
</html>
